﻿package chapter_07_Homework;
/*
 * 		声明一个数组，数组元素为34.2,45.6,87.3,-98.2,123。遍历所有元素，求其最小值。
 */
public class Work_08 {
	public static void main(String[] args) {
		double[] nums = new double[]{34.2,45.6,87.3,-98.2,123};
		for (int i = 0; i < nums.length; i++) {
			System.out.print(nums[i]+" ");
		}
		double min = nums[0];
		for (int i = 1; i < nums.length; i++) {
			if(nums[i]<min)
				min = nums[i];
		}
		System.out.println("最小值是："+min);
	}
}
